package org.jiuling.baidu.nlp.config;

import org.jiuling.baidu.nlp.enums.UseTypeEnum;

/**
 * 自然语言处理配置
 * @author 紫灵
 * @date 2024年08月18日 14时43分05秒
 */
public class BaiDuNlpConfig {

    /** 应用id */
    private String appId;
    /** 应用密钥 */
    private String apiKey;
    /** 密钥 */
    private String secretKey;
    /** 使用类型 */
    private UseTypeEnum useType;

    public String getAppId() {
        return appId;
    }

    public void setAppId(String appId) {
        this.appId = appId;
    }

    public String getApiKey() {
        return apiKey;
    }

    public void setApiKey(String apiKey) {
        this.apiKey = apiKey;
    }

    public String getSecretKey() {
        return secretKey;
    }

    public void setSecretKey(String secretKey) {
        this.secretKey = secretKey;
    }

    public UseTypeEnum getUseType() {
        return useType;
    }

    public void setUseType(UseTypeEnum useType) {
        this.useType = useType;
    }

    /**
     * 建造者
     * @return 建造者
     */
    public static Builder builder(){
        return new Builder();
    }

    public static class Builder {

        /** 百度nlp配置 */
        private final BaiDuNlpConfig baiDuNlpConfig;

        public Builder() {
            this.baiDuNlpConfig = new BaiDuNlpConfig();
        }

        public Builder addAppId(String appId) {
            this.baiDuNlpConfig.appId = appId;
            return this;
        }

        public Builder addApiKey(String apiKey) {
            this.baiDuNlpConfig.apiKey = apiKey;
            return this;
        }

        public Builder addSecretKey(String secretKey) {
            this.baiDuNlpConfig.secretKey = secretKey;
            return this;
        }

        public Builder addUseType(UseTypeEnum useType) {
            this.baiDuNlpConfig.useType = useType;
            return this;
        }

        /**
         * 构建
         * @return 构建
         */
        public BaiDuNlpConfig build() {
            return this.baiDuNlpConfig;
        }

    }
}
